﻿<view:UCModule x:Class="UCOLOR.View.ProductView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
    xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
    xmlns:helpers="clr-namespace:UCOLOR.Helpers" 
    xmlns:local="clr-namespace:UCOLOR.App.Extend"
    xmlns:view="clr-namespace:UColor.WPF"
    xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" xmlns:dxca="http://schemas.devexpress.com/winfx/2008/xaml/carousel"
             mc:Ignorable="d" 
             d:DesignHeight="646" d:DesignWidth="1108" FontWeight="Bold" Focusable="True">
    <view:UCModule.Resources>
        <local:ScalablePaddingConverter x:Key="ScalablePaddingConverter"/>
        <helpers:StringFormatConverter x:Key="StringFormatConverter" />
        <helpers:ImageSourceConverter x:Key="ImageSourceConverter" />
        
        <Style x:Key="VerticalTile" TargetType="dxlc:Tile">
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Size" Value="Small" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate />
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel>
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="14" Margin="0,5,0,0" HorizontalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <Style x:Key="HorizontalTile" TargetType="dxlc:Tile">
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Size" Value="Large" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate />
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="14" Margin="20,0,0,0" VerticalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <Style x:Key="FlatTile" TargetType="dxlc:Tile">
            <Setter Property="Size" Value="Large" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="VerticalHeaderAlignment" Value="Stretch" />
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel>
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="24" Margin="0,5,0,0" HorizontalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </view:UCModule.Resources>
    <view:DemoModuleControl>
         <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="484" />
                    <ColumnDefinition Width="424" />
                    <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="334" />
                    <RowDefinition Height="42" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <dxlc:Tile Header="" HorizontalAlignment="Left" Name="Product" VerticalAlignment="Top" Background="White" Height="258" Width="484">
                        <Image IsManipulationEnabled="False" ></Image>
                    </dxlc:Tile>

                    <Border  BorderThickness="1" Margin="-1,0,2,1" Padding="2" Grid.ColumnSpan="3" Name="Tempalte" Height="237" Grid.Row="2">
                        <Grid Name="TemplateData" Background="#FFFFFFFF"></Grid>
                    </Border>
                <Label Content="名称:" Grid.Column="1" Height="28" HorizontalAlignment="Left" Margin="29,8,0,0" Name="label1" VerticalAlignment="Top" Width="44" FontSize="14" />
                <Label Content="价格:" Grid.Column="1" Height="28" HorizontalAlignment="Left" Margin="31,0,0,264" Name="label3" VerticalAlignment="Bottom" FontSize="14" />
                    <Label Content="{Binding product.ProductName}" Name="ProductName" Grid.Column="1" Margin="75,12,82,299" Height="23" Width="323" />
                    <Label Content="{Binding product.Price}" Name="ProductPrice" Grid.Column="1" Margin="75,46,82,265" Height="23" Width="323" />
                <Button Grid.Row="1" Height="23" HorizontalAlignment="Left" Margin="22,13,0,0" Name="button1" VerticalAlignment="Top" Width="75" Content="马上定制" Grid.Column="1" />
                <Button Content="上传文档" Grid.Column="1" Grid.Row="1" Height="23" HorizontalAlignment="Left" Margin="273,13,0,0" Name="button2" VerticalAlignment="Top" Width="75" />
                <dxlc:TileLayoutControl AllowItemMoving="True" BreakFlowToFit="True" Margin="1,264,0,0" Name="ProductPictures" Orientation="Vertical" Padding="0" Height="112" Grid.RowSpan="2">
                    <dxlc:TileLayoutControl.ItemTemplate>
                        <DataTemplate>
                            <dxlc:Tile Click="Tile_Click" Content="{Binding}"  Height="100" Padding="0" helpers:TileSelectHelper.ComparisonPropertyPath="ID" VerticalHeaderAlignment="Stretch" Width="100" helpers:ZoomHelper.SupressZoomFactor="300">
                                <dxlc:Tile.ContentTemplate>
                                    <DataTemplate>
                                        <Image Source="{Binding PhotoSource}" Stretch="UniformToFill" />
                                    </DataTemplate>
                                </dxlc:Tile.ContentTemplate>
                            </dxlc:Tile>
                        </DataTemplate>
                    </dxlc:TileLayoutControl.ItemTemplate>
                </dxlc:TileLayoutControl>
                <Label Content="尺寸" FontSize="14" Height="28" HorizontalAlignment="Left" Margin="31,0,0,230" Name="label2" VerticalAlignment="Bottom" Grid.Column="1" />
                <Label Content="价格:" FontSize="14" Height="28" HorizontalAlignment="Left" Margin="31,0,0,196" Name="label4" VerticalAlignment="Bottom" Grid.Column="1" />
                <Label Content="材质:" FontSize="14" Height="28" HorizontalAlignment="Left" Margin="31,0,0,162" Name="label5" VerticalAlignment="Bottom" Grid.Column="1" />
                <Label Content="工艺:" FontSize="14" Height="28" HorizontalAlignment="Left" Margin="31,0,0,128" Name="label6" VerticalAlignment="Bottom" Grid.Column="1" />
                <CheckBox Content="是否套板" Grid.Column="1" Height="16" HorizontalAlignment="Left" Margin="144,223,0,0" Name="checkBox1" VerticalAlignment="Top" />
                <CheckBox Content="是否修片" Grid.Column="1" Height="16" HorizontalAlignment="Left" Margin="37,223,0,0" Name="checkBox2" VerticalAlignment="Top" />
                <Button Content="收藏" Grid.Column="1" Grid.Row="1" Height="23" HorizontalAlignment="Left" Margin="144,13,0,0" Name="button3" VerticalAlignment="Top" Width="75" />
         </Grid>
   </view:DemoModuleControl>
</view:UCModule>
